

--------------------------------------------------------------------------- KeyError Traceback (most recent call last) /opt/conda/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3360 try: -> 3361 return self._engine.get_loc(casted_key) 3362 except KeyError as err: /opt/conda/lib/python3.9/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() /opt/conda/lib/python3.9/site-packages/pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: 'DATEAWR' The above exception was the direct cause of the following exception: KeyError Traceback (most recent call last) /tmp/ipykernel_30/3396862332.py in <module> 4 df = pd.read_csv('https://raw.githubusercontent.com/unpetee/getocidisks/master/redo.csv') 5 ----> 6 df['DATEAWR']= pd.to_datetime(df['DATEAWR'],format="%d/%m/%Y %H:%M").dt.strftime('%d/%m/%Y %H') 7 df['DATEAWR']= pd.to_datetime(df['DATEAWR'],format="%d/%m/%Y %H") 8 #df.loc[df.DATA > 0, 'B'] = df.DATA /opt/conda/lib/python3.9/site-packages/pandas/core/frame.py in __getitem__(self, key) 3456 if self.columns.nlevels > 1: 3457 return self._getitem_multilevel(key) -> 3458 indexer = self.columns.get_loc(key) 3459 if is_integer(indexer): 3460 indexer = [indexer] /opt/conda/lib/python3.9/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3361 return self._engine.get_loc(casted_key) 3362 except KeyError as err: -> 3363 raise KeyError(key) from err 3364 3365 if is_scalar(key) and isna(key) and not self.hasnans: KeyError: 'DATEAWR'